package com.xgst.bmg.sse.service;

import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * @BelongsProject: screen-win
 * @BelongsPackage: com.xgst.bmg.sse.service
 * @Author: xgstjs-11
 * @CreateTime: 2021-05-18 14:09:22
 * @Description: SSE Service
 */
public interface SSEService {

    /**
     * 新建连接
     *
     * @param clientId 客户端ID
     * @return
     */
    SseEmitter start(String clientId);

    /**
     * 发送数据
     *
     * @param clientId 客户端ID
     * @return
     */
    int send(String clientId, String msg);

    /**
     * 关闭连接
     *
     * @param clientId 客户端ID
     * @return
     */
    String close(String clientId);
}
